package com.last.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.last.entity.RoomInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface RoomInfoMapper extends BaseMapper<RoomInfo> {

    // 获取所有房屋信息列表
    public IPage<RoomInfo> roomList(@Param("iPage") IPage<RoomInfo> iPage, @Param("roomInfo") RoomInfo roomInfo);

    // 审核(设置)房屋信息(状态)  0可预订 1 已预定 2 下架 3审核中
    @Update("update room_info set room_status = '0' where room_id=#{roomId}")
    public int setRoomStatus(RoomInfo roomInfo);

    // 设置成不通过
    @Update("update room_info set room_status = '4' where room_id=#{roomId}")
    public int setRoomStatusNoPass(RoomInfo roomInfo);
}
